home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 14 / Hot Mix 14.iso / HTML / vendors / finesse / examples / csh / file_selection < prev    next >
Text File  |  1996-06-27  |  807b  |  51 lines

  1. #! /bin/csh
  2. # FINESSEAPPLICATIONKEY spOsFfb||~Lc[
  3.  
  4. if ( ! $?FINESSEPATH ) \
  5.  set FINESSEPATH = /usr/local/finesse
  6. source $FINESSEPATH/fscshinit
  7.  
  8. set tmpfile = /tmp/$$.tmp
  9.  
  10. Fsopen
  11.  
  12. cat << EOT > $tmpfile
  13. FsWindow        -title 'Example File Selection'
  14. -btype oxxa ;
  15. FsSeparator;
  16. FsSelectionText -var filename
  17. -label 'Select file:';
  18. FsSeparator;
  19. EOT
  20.  
  21. Fsdisplay -f $tmpfile
  22. if ("$fsbutton" != "o") then
  23. Fsclose
  24. /bin/rm -f $tmpfile
  25. exit 1
  26. endif
  27.  
  28. Fssave 
  29.  
  30. if ( $filename != "" ) then
  31. if ( -f $filename ) then
  32. set longlist = `ls -l $filename`
  33. Fsecho -r 3 -c 80 -t "Long listing of $filename"\:
  34. Fsecho \ \ $longlist
  35. else 
  36. Fsecho File not found.
  37. endif
  38. else
  39. Fsecho No file selected.
  40. endif
  41.  
  42. cat << EOT > $tmpfile
  43. FsWindow -btype o; 
  44. FsSeparator;
  45. EOT
  46.  
  47. Fsdisplay -m "OK to quit." < $tmpfile
  48. /bin/rm -f $tmpfile
  49.  
  50. Fsclose
  51.